package com.bmsbosmpa.controller;

import com.bmsbosmpa.controller.util.Message;
import com.bmsbosmpa.entity.User;
import com.bmsbosmpa.service.implement.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("users")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping
    public Message login(@RequestBody User user) {
        return userService.login(user);
    }

//    @PostMapping
//    public Message login(@RequestParam String id, @RequestParam String password) {
//        User user = new User();
//        user.setId(id);
//        user.setPassword(password);
//        Boolean status = userService.login(user) != null;
//        return new Message(status, userService.login(user));
//    }
//
//
//    @GetMapping
//    public Message queryAll() {
//        return new Message(true, userService.list());
//    }


}
